package com.ityuxin.dao;

import com.ityuxin.domain.Customer;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Author: yyh
 * @Description:
 * @Date:Create：in 2021/4/3 15:51
 * @Modified By：
 */
public interface CustomerMapper {

    @Select("select *  from Customer")
    List<Customer> findAll();

    @Delete("delete from Customer where id = #{id} ")
    void deleteById(Integer id);

    @Insert("insert into Customer values(null,#{birthday},#{gender},#{customerName},#{remark},#{station},#{telephone},#{address}) ")
    void addCustomer(Customer customer);

    @Update("update Customer set  address=#{address},birthday=#{birthday},address=#{address},customerName=#{customerName},gender=#{gender},remark=#{remark},station=#{station},telephone=#{telephone} where id=#{id} ")
    void updateCustomer(Customer customer);


    @Select("select  *  from Customer where id = #{id}")
    Customer findById(@Param("id") Integer id);
}
